/**
 * @file
 * @description 权限模块接口文件
 */

import request from "./request";

/**
 * @file
 * @description 获取所以菜单
 */
export const getMenus=()=>request.get("menus");

/**
 * 获取角色
 */
 export const getRoles=()=>request.get("roles");

 //修改角色
 export const updataRole=(id,rid)=>request.put(`users/${id}/role`,{rid});

//获取角色列表数据
export const getRightsList=()=>request.get('rights/list')
//删除权限
export const deleteRights=(roleId,rightsId)=>request.delete(`/roles/${roleId}/rights/${rightsId}`)
//删除角色
export const deleteRole=(id)=>request.delete(`roles/${id}`)
//添加角色
export const  addRole=(model)=>request.post('roles',model)
//修改角色
export const modifyRole=(model)=>request.put(`roles/${model.id}`,model)
//获取菜单树形数据
export const getMenuTree=()=>request.get('rights/tree')
 //分配权限
 export const assignRights=(id,rids)=>request.post(`roles/${id}/rights`,{rids})